<template>
<div>
    <h1>航数资产报销系统</h1>
    {{isLoading}}
    <ul>
        <li><a :href="link" target="_blank">百度</a></li>
        <li><a :href="url" target="_blank">hao123</a></li>
        <li><a :href="url" target="_blank">hao123</a></li>
        <li><a :href="url" target="_blank">hao123</a></li>
        <li><a :href="url" target="_blank">hao123</a></li>
        <!-- 名称：<input type="text">
        <hr>
        库存：<input type="text">
        <input type="submit"> -->
    </ul>
    <ul>
        名称：<input type="text" v-model="new_pro.name">
        库存：<input type="text" v-model="new_pro.stock">
        <input type="submit" @click="add()">
    </ul>

    <ul>
        <li v-for="(item, index) in producters" :key="index">{{item.name}},{{item.stock}}</li>
    </ul>
</div>

  
</template>

<script>
import {mapState} from "vuex"    //
var res=mapState("channels",["data","isLoading"])     //
console.log(res)
export default {
computed:
// {
    res,
    // isLoading(){
    //     return this.$store.state.channels.data
    // }
// },
    data(){
        return{
            link:"https://www.baidu.com",
            url:"https://www.hao123.com",
            new_pro:{name:"华为手机",stock:"299"},
            producters:[{name:"小米",stock:2},{name:"苹果",stock:3}]
        }
    },
    methods: {
      add(){
          this.producters.push({name:this.new_pro.name, stock:this.new_pro.stock})
          console.log(this.producters)
      }  
    
    },

}
</script>


<style>


</style>